package com.ks.app.search.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class RequestUtil {
	
	
	public static String sendConnRequest(String urlString){
	
		StringBuffer document = new StringBuffer();
		java.net.HttpURLConnection conn = null;
		try {
			URL url = new URL(urlString);
			conn = (HttpURLConnection) url.openConnection();
			BufferedReader reader = new BufferedReader(new InputStreamReader(
					conn.getInputStream(), "utf-8"));
			String line = null;
			while ((line = reader.readLine()) != null)
				document.append(line + "\n");
			reader.close();
		} catch (MalformedURLException e) {
		} catch (IOException e) {
		} finally {
			conn.disconnect();
		}
		return document.toString();
	}	

}
